<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
 </tr>
 </tbody>
</table>
</div>
<body bgcolor="#ffffff">
<table width="100%">
  <tr>
    <td width="30%" align="left" valign="center">
      <a href="https://github.com/open-source-parsers/jsoncpp">
      JsonCpp project page
      </a>
    </td>
    <td width="20%" align="center" valign="center">
      <a href="hierarchy.html">
        Classes
      </a>
    </td>
    <td width="20%" align="center" valign="center">
      <a href="namespace_json.html">
        Namespace
      </a>
    </td>
    <td width="30%" align="right" valign="center">
      <a href="http://open-source-parsers.github.io/jsoncpp-docs/doxygen/">JsonCpp home page</a>
    </td>
  </tr>
</table>
<hr>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_json_1_1_stream_writer_builder.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="class_json_1_1_stream_writer_builder-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Json::StreamWriterBuilder Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Build a <a class="el" href="class_json_1_1_stream_writer.html" title="Usage: ">StreamWriter</a> implementation.  
 <a href="class_json_1_1_stream_writer_builder.html#details">More...</a></p>

<p><code>#include &lt;json/writer.h&gt;</code></p>

<p>Inherits <a class="el" href="class_json_1_1_stream_writer_1_1_factory.html">Json::StreamWriter::Factory</a>.</p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ab95b76179c152673ad14abc639a46ee4"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_json_1_1_stream_writer_builder.html#ab95b76179c152673ad14abc639a46ee4">StreamWriterBuilder</a> ()</td></tr>
<tr class="separator:ab95b76179c152673ad14abc639a46ee4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0dadc1659528d6be355b2ecc6019a1b2"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_json_1_1_stream_writer_builder.html#a0dadc1659528d6be355b2ecc6019a1b2">~StreamWriterBuilder</a> ()</td></tr>
<tr class="separator:a0dadc1659528d6be355b2ecc6019a1b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ace419fb128e2ac4f124c95245f8f9ff6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_json_1_1_stream_writer.html">StreamWriter</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_json_1_1_stream_writer_builder.html#ace419fb128e2ac4f124c95245f8f9ff6">newStreamWriter</a> () const</td></tr>
<tr class="separator:ace419fb128e2ac4f124c95245f8f9ff6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a12353b97766841db7d049da84658da09"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_json_1_1_stream_writer_builder.html#a12353b97766841db7d049da84658da09">validate</a> (<a class="el" href="class_json_1_1_value.html">Json::Value</a> *invalid) const</td></tr>
<tr class="separator:a12353b97766841db7d049da84658da09"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa010a8a04a92343179f64a5dbb5df340"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_json_1_1_value.html">Value</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_json_1_1_stream_writer_builder.html#aa010a8a04a92343179f64a5dbb5df340">operator[]</a> (std::string key)</td></tr>
<tr class="memdesc:aa010a8a04a92343179f64a5dbb5df340"><td class="mdescLeft">&#160;</td><td class="mdescRight">A simple way to update a specific setting.  <a href="#aa010a8a04a92343179f64a5dbb5df340">More...</a><br /></td></tr>
<tr class="separator:aa010a8a04a92343179f64a5dbb5df340"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_class_json_1_1_stream_writer_1_1_factory"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_json_1_1_stream_writer_1_1_factory')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="class_json_1_1_stream_writer_1_1_factory.html">Json::StreamWriter::Factory</a></td></tr>
<tr class="memitem:ad334ad5e81e3b9b1768620a446366ff1 inherit pub_methods_class_json_1_1_stream_writer_1_1_factory"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_json_1_1_stream_writer_1_1_factory.html#ad334ad5e81e3b9b1768620a446366ff1">~Factory</a> ()</td></tr>
<tr class="separator:ad334ad5e81e3b9b1768620a446366ff1 inherit pub_methods_class_json_1_1_stream_writer_1_1_factory"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a53bf106b141e28637b01ad0ecd2acbf6"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_json_1_1_stream_writer_builder.html#a53bf106b141e28637b01ad0ecd2acbf6">setDefaults</a> (<a class="el" href="class_json_1_1_value.html">Json::Value</a> *settings)</td></tr>
<tr class="memdesc:a53bf106b141e28637b01ad0ecd2acbf6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called by ctor, but you can use this to reset settings_.  <a href="#a53bf106b141e28637b01ad0ecd2acbf6">More...</a><br /></td></tr>
<tr class="separator:a53bf106b141e28637b01ad0ecd2acbf6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a79bdf2e639a52f4e758c0b95bd1d3423"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_json_1_1_value.html">Json::Value</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_json_1_1_stream_writer_builder.html#a79bdf2e639a52f4e758c0b95bd1d3423">settings_</a></td></tr>
<tr class="memdesc:a79bdf2e639a52f4e758c0b95bd1d3423"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configuration of this builder.  <a href="#a79bdf2e639a52f4e758c0b95bd1d3423">More...</a><br /></td></tr>
<tr class="separator:a79bdf2e639a52f4e758c0b95bd1d3423"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Build a <a class="el" href="class_json_1_1_stream_writer.html" title="Usage: ">StreamWriter</a> implementation. </p>
<p>Usage: </p><div class="fragment"><div class="line"><span class="keyword">using namespace </span><a class="code" href="namespace_json.html">Json</a>;</div><div class="line"><a class="code" href="class_json_1_1_value.html">Value</a> value = ...;</div><div class="line"><a class="code" href="class_json_1_1_stream_writer_builder.html">StreamWriterBuilder</a> builder;</div><div class="line">builder[<span class="stringliteral">&quot;commentStyle&quot;</span>] = <span class="stringliteral">&quot;None&quot;</span>;</div><div class="line">builder[<span class="stringliteral">&quot;indentation&quot;</span>] = <span class="stringliteral">&quot;   &quot;</span>;  <span class="comment">// or whatever you like</span></div><div class="line">std::unique_ptr&lt;Json::StreamWriter&gt; writer(</div><div class="line">    builder.<a class="code" href="class_json_1_1_stream_writer_builder.html#ace419fb128e2ac4f124c95245f8f9ff6">newStreamWriter</a>());</div><div class="line">writer-&gt;write(value, &amp;std::cout);</div><div class="line">std::cout &lt;&lt; std::endl;  <span class="comment">// add lf and flush</span></div></div><!-- fragment --> </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ab95b76179c152673ad14abc639a46ee4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab95b76179c152673ad14abc639a46ee4">&#9670;&nbsp;</a></span>StreamWriterBuilder()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Json::StreamWriterBuilder::StreamWriterBuilder </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a0dadc1659528d6be355b2ecc6019a1b2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0dadc1659528d6be355b2ecc6019a1b2">&#9670;&nbsp;</a></span>~StreamWriterBuilder()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Json::StreamWriterBuilder::~StreamWriterBuilder </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="ace419fb128e2ac4f124c95245f8f9ff6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ace419fb128e2ac4f124c95245f8f9ff6">&#9670;&nbsp;</a></span>newStreamWriter()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_json_1_1_stream_writer.html">StreamWriter</a> * Json::StreamWriterBuilder::newStreamWriter </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">std::exception</td><td>if something goes wrong (e.g. invalid settings) </td></tr>
  </table>
  </dd>
</dl>

<p>Implements <a class="el" href="class_json_1_1_stream_writer_1_1_factory.html#a9d30ec53e8288cd53befccf1009c5f31">Json::StreamWriter::Factory</a>.</p>

</div>
</div>
<a id="aa010a8a04a92343179f64a5dbb5df340"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa010a8a04a92343179f64a5dbb5df340">&#9670;&nbsp;</a></span>operator[]()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_json_1_1_value.html">Value</a> &amp; Json::StreamWriterBuilder::operator[] </td>
          <td>(</td>
          <td class="paramtype">std::string&#160;</td>
          <td class="paramname"><em>key</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A simple way to update a specific setting. </p>

</div>
</div>
<a id="a53bf106b141e28637b01ad0ecd2acbf6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a53bf106b141e28637b01ad0ecd2acbf6">&#9670;&nbsp;</a></span>setDefaults()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Json::StreamWriterBuilder::setDefaults </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_json_1_1_value.html">Json::Value</a> *&#160;</td>
          <td class="paramname"><em>settings</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Called by ctor, but you can use this to reset settings_. </p>
<dl class="section pre"><dt>Precondition</dt><dd>'settings' != NULL (but Json::null is fine) </dd></dl>
<dl class="section remark"><dt>Remarks</dt><dd>Defaults: <div class="fragment"><div class="line">  (*settings)[<span class="stringliteral">&quot;commentStyle&quot;</span>] = <span class="stringliteral">&quot;All&quot;</span>;</div><div class="line">  (*settings)[<span class="stringliteral">&quot;indentation&quot;</span>] = <span class="stringliteral">&quot;\t&quot;</span>;</div><div class="line">  (*settings)[<span class="stringliteral">&quot;enableYAMLCompatibility&quot;</span>] = <span class="keyword">false</span>;</div><div class="line">  (*settings)[<span class="stringliteral">&quot;dropNullPlaceholders&quot;</span>] = <span class="keyword">false</span>;</div><div class="line">  (*settings)[<span class="stringliteral">&quot;useSpecialFloats&quot;</span>] = <span class="keyword">false</span>;</div><div class="line">  (*settings)[<span class="stringliteral">&quot;precision&quot;</span>] = 17;</div></div><!-- fragment --></dd></dl>
<p>[StreamWriterBuilderDefaults]</p>
<p>[StreamWriterBuilderDefaults] </p>

</div>
</div>
<a id="a12353b97766841db7d049da84658da09"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a12353b97766841db7d049da84658da09">&#9670;&nbsp;</a></span>validate()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Json::StreamWriterBuilder::validate </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_json_1_1_value.html">Json::Value</a> *&#160;</td>
          <td class="paramname"><em>invalid</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>true if 'settings' are legal and consistent; otherwise, indicate bad settings via 'invalid'. </dd></dl>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a79bdf2e639a52f4e758c0b95bd1d3423"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a79bdf2e639a52f4e758c0b95bd1d3423">&#9670;&nbsp;</a></span>settings_</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_json_1_1_value.html">Json::Value</a> Json::StreamWriterBuilder::settings_</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Configuration of this builder. </p>
<p>Available settings (case-sensitive):</p><ul>
<li>"commentStyle": "None" or "All"</li>
<li>"indentation": "&lt;anything&gt;"</li>
<li>"enableYAMLCompatibility": false or true<ul>
<li>slightly change the whitespace around colons</li>
</ul>
</li>
<li>"dropNullPlaceholders": false or true<ul>
<li>Drop the "null" string from the writer's output for nullValues. Strictly speaking, this is not valid JSON. But when the output is being fed to a browser's Javascript, it makes for smaller output and the browser can handle the output just fine.</li>
</ul>
</li>
<li>"useSpecialFloats": false or true<ul>
<li>If true, outputs non-finite floating point values in the following way: NaN values as "NaN", positive infinity as "Infinity", and negative infinity as "-Infinity".</li>
</ul>
</li>
</ul>
<p>You can examine 'settings_` yourself to see the defaults. You can also write and read them just like any JSON <a class="el" href="class_json_1_1_value.html" title="Represents a JSON value. ">Value</a>. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="class_json_1_1_stream_writer_builder.html#a53bf106b141e28637b01ad0ecd2acbf6" title="Called by ctor, but you can use this to reset settings_. ">setDefaults()</a> </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>include/json/<a class="el" href="writer_8h.html">writer.h</a></li>
<li>src/lib_json/<a class="el" href="json__writer_8cpp.html">json_writer.cpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.13-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespace_json.html">Json</a></li><li class="navelem"><a class="el" href="class_json_1_1_stream_writer_builder.html">StreamWriterBuilder</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
